import { useMessage } from '/@/hooks/web/useMessage';

interface confirmOptions {
  title: string;
  content: string;
  iconType: 'success' | 'info' | 'error' | 'warning';
  confirmCallback?: Function;
  concelCallback?: Function;
  isConcle?: boolean;
}

const { createConfirm, createErrorModal } = useMessage();

// 底部带取消按钮弹框
export const modelConfirm = (options: confirmOptions): void => {
  const { title, content, iconType, confirmCallback } = options;
  createConfirm({
    iconType,
    title,
    content,
    onOk() {
      confirmCallback && confirmCallback();
    }
  })
}

// 底部不带取消按钮
export const modelConfirmNoConcel  = (options: confirmOptions): void => {
  const { title, content, iconType } = options;
  createErrorModal({
    iconType,
    title,
    content,
    onOk() {
      // successFn()
    }
  })
}

